package com.example.demo.web;

import com.example.demo.bean.ConfigBean;
import com.example.demo.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/11/30.
 */
@RestController
@EnableConfigurationProperties({ConfigBean.class, User.class})
public class LucyController {
    @Autowired
    ConfigBean configBean;

    @RequestMapping(value = "/lucy")
    public String lucy(){
        return configBean.getGreeting()+" >>>"+configBean.getName()+" >>>"+configBean.getUuid()+" >>>"+configBean.getMax();
    }
    @Autowired
    User user;
    @RequestMapping(value = "user")
    public String user(){
        return user.getName()+user.getAge();
    }
}
